<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserCapitalLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_capital_log', function (Blueprint $table) {
            $table->integer('id', true);
            $table->integer('user_id')->comment('用户ID');
            $table->boolean('operate')->default(0)->comment('操作类型1充值2扣除');
            $table->boolean('type')->default(0)->comment('类型1余额2积分');
            $table->boolean('status')->default(0)->comment('状态');
            $table->decimal('amount', 10)->default(0.00)->comment('金额');
            $table->integer('admin_id')->default(0)->comment('操作人ID');
            $table->string('operate_name', 100)->default('')->comment('操作人名称');
            $table->string('description')->default('')->comment('描述');
            $table->timestamp('created_at');
            $table->timestamp('updated_at');
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_capital_log');
    }
}
